Skip to content

[SOT][Faster Guard] Implement more make_faster_guard #72272

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 11 commits into from
Apr 17, 2025

Conversation

zrr1999
Copy link
Member

@zrr1999 zrr1999 commented Apr 15, 2025

PR Category

Execute Infrastructure

PR Types

Performance

Description

当 STRICT_GUARD 没开启且GUARD_TREE开启时,如果guard tree没有命中,也就是cache_index为None之前会再找一次,fasterguard(pyguard),本PR把这个逻辑去掉了,guard tree没有命中则直接视为guard miss,不会再去其他guard模式找。

另外实现了下述make_faster_guard:

  • ContainerVariable.make_faster_guard
  • object_equal_faster_guard
  • LayerVariable.make_faster_guard
  • PaddleLayerVariable.make_faster_guard
  • ContainerLayerVariable.make_faster_guard
  • DygraphTracerVariable.make_faster_guard
  • NumpyNumberVariable.make_faster_guard
  • NumpyArrayVariable.make_faster_guard
  • SliceVariable.make_faster_guard

目前还差2个:

  • NumpyVariable,这个的 make_stringified_guard 也没有实现
  • SymbolicVariable

@zrr1999 zrr1999 requested review from SigureMo and gouzil as code owners April 15, 2025 08:17
Copy link

paddle-bot bot commented Apr 15, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@paddle-bot paddle-bot bot added the contributor External developers label Apr 15, 2025
@zrr1999 zrr1999 changed the title Guard tree node [SOT][Faster Guard] implement more make_faster_guard Apr 15, 2025
if (value == NULL) {
PyErr_Clear();
return false;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里是不是可以写一个宏来处理?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感觉可以

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

下个 PR,这个 PR 先合吧

SigureMo
SigureMo previously approved these changes Apr 16, 2025
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@SigureMo
Copy link
Member

NumpyVariable,这个的 make_stringified_guard 也没有实现

NumpyVariable 不用管,只需要管子类 NumpyNumberNumpyArray 即可

@SigureMo SigureMo changed the title [SOT][Faster Guard] implement more make_faster_guard [SOT][Faster Guard] implement more make_faster_guard Apr 17, 2025
@SigureMo SigureMo changed the title [SOT][Faster Guard] implement more make_faster_guard [SOT][Faster Guard] Implement more make_faster_guard Apr 17, 2025
Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTMeow 🐾

@SigureMo SigureMo merged commit ec59644 into PaddlePaddle:develop Apr 17, 2025
38 of 39 checks passed
@zrr1999 zrr1999 deleted the guard_tree_node branch April 17, 2025 11:26
YqGe585 pushed a commit to YqGe585/Paddle that referenced this pull request May 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor External developers
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants